<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddUnionIdAndRelateIdToUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('mckj_user', function (Blueprint $table) {
            $table->string('union_id')->nullable()->comment('union ID');
            $table->integer('relate_id')->default(0)->comment('关联用户Id');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('mckj_user', function (Blueprint $table) {
            $table->dropColumn('union_id');
            $table->dropColumn('relate_id');
        });
    }
}
